package com.fr.cell.core;

import com.fr.base.BaseUtils;
import com.fr.base.Inter;
import com.fr.data.util.function.AverageFunction;
import com.fr.data.util.function.CountFunction;
import com.fr.data.util.function.DataFunction;
import com.fr.data.util.function.MaxFunction;
import com.fr.data.util.function.MinFunction;
import com.fr.data.util.function.NoneFunction;
import com.fr.data.util.function.SumFunction;
import com.fr.report.core.headerfooter.DateHFElement;
import com.fr.report.core.headerfooter.FormulaHFElement;
import com.fr.report.core.headerfooter.HFElement;
import com.fr.report.core.headerfooter.ImageHFElement;
import com.fr.report.core.headerfooter.NewLineHFElement;
import com.fr.report.core.headerfooter.NumberOfPageHFElement;
import com.fr.report.core.headerfooter.PageNumberHFElement;
import com.fr.report.core.headerfooter.TextHFElement;
import com.fr.report.core.headerfooter.TimeHFElement;
import java.awt.Cursor;
import java.awt.Point;
import java.awt.Toolkit;
import javax.swing.Icon;

public class GUIConstants
{
  private static Icon blankIcon = null;
  public static final Cursor CellDefaultCursor = Toolkit.getDefaultToolkit().createCustomCursor(BaseUtils.readImage("/com/fr/cell/images/cursor/cell_default.png"), new Point(16, 16), "CellDefaultCursor");
  public static final Cursor DrawCursor = Toolkit.getDefaultToolkit().createCustomCursor(BaseUtils.readImage("/com/fr/cell/images/cursor/cursor_draw.png"), new Point(16, 16), "DrawCursor");
  public static DataFunction[] FunctionArray = null;
  public static int[] BorderlineStyleArray = { 1, 2, 3, 4, 14, 5, 6, 7, 8, 9, 10, 11, 12, 13 };

  public static Icon getBlankIcon()
  {
    if (blankIcon == null)
      blankIcon = BaseUtils.readIcon("/com/fr/cell/images/blank.gif");
    return blankIcon;
  }

  public static DataFunction[] getFunctionArray()
  {
    if (FunctionArray == null)
      FunctionArray = new DataFunction[] { new SumFunction(), new AverageFunction(), new MaxFunction(), new MinFunction(), new CountFunction(), new NoneFunction() };
    return FunctionArray;
  }

  public static String getHFELementText(HFElement paramHFElement)
  {
    if (paramHFElement.getClass().equals(TextHFElement.class))
      return Inter.getLocText("Text");
    if (paramHFElement.getClass().equals(FormulaHFElement.class))
      return Inter.getLocText("Formula");
    if (paramHFElement.getClass().equals(PageNumberHFElement.class))
      return Inter.getLocText("HF-Page_Number");
    if (paramHFElement.getClass().equals(NumberOfPageHFElement.class))
      return Inter.getLocText("HF-Number_of_Page");
    if (paramHFElement.getClass().equals(DateHFElement.class))
      return Inter.getLocText("Date");
    if (paramHFElement.getClass().equals(TimeHFElement.class))
      return Inter.getLocText("Time");
    if (paramHFElement.getClass().equals(ImageHFElement.class))
      return Inter.getLocText("Image");
    if (paramHFElement.getClass().equals(NewLineHFElement.class))
      return Inter.getLocText("HF-New_Line");
    return Inter.getLocText("HF-Undefined");
  }

  public static String getHFELementInsertToolTip(HFElement paramHFElement)
  {
    if (paramHFElement.getClass().equals(TextHFElement.class))
      return Inter.getLocText("HF-Insert_Text");
    if (paramHFElement.getClass().equals(FormulaHFElement.class))
      return Inter.getLocText("HF-Insert_Formula");
    if (paramHFElement.getClass().equals(PageNumberHFElement.class))
      return Inter.getLocText("HF-Insert_Page_Number");
    if (paramHFElement.getClass().equals(NumberOfPageHFElement.class))
      return Inter.getLocText("HF-Insert_Number_of_Page");
    if (paramHFElement.getClass().equals(DateHFElement.class))
      return Inter.getLocText("HF-Insert_Date");
    if (paramHFElement.getClass().equals(TimeHFElement.class))
      return Inter.getLocText("HF-Insert_Time");
    if (paramHFElement.getClass().equals(ImageHFElement.class))
      return Inter.getLocText("HF-Insert_Image");
    if (paramHFElement.getClass().equals(NewLineHFElement.class))
      return Inter.getLocText("HF-Insert_New_Line");
    return Inter.getLocText("Undefined");
  }

  public static Icon getHFElementIcon(HFElement paramHFElement)
  {
    if (paramHFElement.getClass().equals(TextHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/text.png");
    if (paramHFElement.getClass().equals(FormulaHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/formula.png");
    if (paramHFElement.getClass().equals(PageNumberHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/page.png");
    if (paramHFElement.getClass().equals(NumberOfPageHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/pages.png");
    if (paramHFElement.getClass().equals(DateHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/date.png");
    if (paramHFElement.getClass().equals(TimeHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/time.png");
    if (paramHFElement.getClass().equals(ImageHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/image.png");
    if (paramHFElement.getClass().equals(NewLineHFElement.class))
      return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/newLine.png");
    return BaseUtils.readIcon("/com/fr/dialog/images/headerfooter/undefined.png");
  }
}